package com.ruoyi.supplier.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supplier.mapper.TbBankMapper;
import com.ruoyi.supplier.domain.TbBank;
import com.ruoyi.supplier.service.ITbBankService;

/**
 * 银行Service业务层处理
 * 
 * @author oliver.li
 * @date 2021-08-14
 */
@Service
public class TbBankServiceImpl implements ITbBankService 
{
    @Autowired
    private TbBankMapper tbBankMapper;

    /**
     * 查询银行
     * 
     * @param id 银行ID
     * @return 银行
     */
    @Override
    public TbBank selectTbBankById(Long id)
    {
        return tbBankMapper.selectTbBankById(id);
    }

    /**
     * 查询银行列表
     * 
     * @param tbBank 银行
     * @return 银行
     */
    @Override
    public List<TbBank> selectTbBankList(TbBank tbBank)
    {
        return tbBankMapper.selectTbBankList(tbBank);
    }

    /**
     * 新增银行
     * 
     * @param tbBank 银行
     * @return 结果
     */
    @Override
    public int insertTbBank(TbBank tbBank)
    {
        tbBank.setCreateTime(DateUtils.getNowDate());
        return tbBankMapper.insertTbBank(tbBank);
    }

    /**
     * 修改银行
     * 
     * @param tbBank 银行
     * @return 结果
     */
    @Override
    public int updateTbBank(TbBank tbBank)
    {
        tbBank.setUpdateTime(DateUtils.getNowDate());
        return tbBankMapper.updateTbBank(tbBank);
    }

    /**
     * 批量删除银行
     * 
     * @param ids 需要删除的银行ID
     * @return 结果
     */
    @Override
    public int deleteTbBankByIds(Long[] ids)
    {
        return tbBankMapper.deleteTbBankByIds(ids);
    }

    /**
     * 删除银行信息
     * 
     * @param id 银行ID
     * @return 结果
     */
    @Override
    public int deleteTbBankById(Long id)
    {
        return tbBankMapper.deleteTbBankById(id);
    }
}
